#ifndef _GWBASE_BASE_BYTE_ORDER_
#define _GWBASE_BASE_BYTE_ORDER_

#include <endian.h>
#include <stdint.h>

namespace dicom {

#if defined(__clang__) || __GNUC_MINOR__ >= 6
#pragma GCC diagnostic push
#endif
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wold-style-cast"

inline uint16_t hton16(uint16_t h) { return htobe16(h); }
inline uint32_t hton32(uint32_t h) { return htobe32(h); }
inline uint64_t hton64(uint64_t h) { return htobe64(h); }

inline uint16_t ntoh16(uint16_t n) { return be16toh(n); }
inline uint32_t ntoh32(uint32_t n) { return be32toh(n); }
inline uint64_t ntoh64(uint64_t n) { return be64toh(n); }

#if defined(__clang__) || __GNUC_MINOR__ >= 6
#pragma GCC diagnostic pop
#else
#pragma GCC diagnostic warning "-Wconversion"
#pragma GCC diagnostic warning "-Wold-style-cast"
#endif

}

#endif //  _GWBASE_BASE_BYTE_ORDER_
